package com.itheima.io.objectoutputstream.demo01;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

public class ObjectOutputStreamDemo01 {

    public static void main(String[] args) throws IOException {

//        Student s1 = new Student("蓝湛", 15);
        Student s1 = new Student("蓝湛", 15, "云深不知处");

        ObjectOutputStream objectOutputStream = new ObjectOutputStream(new FileOutputStream("itheima-io-objectoutstream\\obj.txt"));

        objectOutputStream.writeObject(s1);

        objectOutputStream.close();

    }
}
